import httpClient from "./http-client";

export class AuthService {
    baseUrl = "/api/v1.0/admin/auth";
    verifyCodeUrl = `${this.baseUrl}/verify-code`;

    async getVerifyCode() {
        return httpClient.get(`${this.baseUrl}/verify-code?timestamp=${new Date().getTime()}`, false);
    }

    async login(param) {
        return httpClient.post(`${this.baseUrl}/login`, {
            ...param,
        }, false);
    }

    async logout() {
        return httpClient.post(`${this.baseUrl}/logout`);
    }
}

const authService = new AuthService();

export default authService;